<div id="icon-edit" class="icon32"><br /></div>
<h2>Surat Review Opinion
<?=anchor('opsurat/addreview','Add New',array('class'=>'button add-new-h2'));?>
<?=anchor('opsurat/re_excel','Transfer ke Excel',array('class'=>'button add-new-h2'));?>

</h2>

<p></p>
<?=form_open('opsurat/re_action/');?>
<p class="search-box">
<?php if(($this->session->userdata('no_opsurat')=='') AND ($this->session->userdata('klien_opsurat')=='') ) :?>
	 No Surat
	<input type="text" id="post-search-input" name="no" value="" />
	 Nama Klien
	<input type="text" id="post-search-input" name="s" value="" />	
	<input type="submit" value="Search" name="search" class="button" />
<?php else:?>
	<input type="submit" value="Reset" name="reset" class="button" />
<?php endif;?>	
</p>
<?=form_close();?>
<br/>
<p></p>


<div class="tablenav">

<?=form_open('opsurat/re_date/');?>
<div class="alignleft actions">
<!--
<select name="action">
<option value="-1" selected="selected">Bulk Actions</option>
<option value="edit">Edit</option>
<option value="trash">Move to Trash</option>
</select>
<input type="submit" value="Apply" name="doaction" id="doaction" class="button-secondary action" />
<input type="hidden" id="_wpnonce" name="_wpnonce" value="320265c495" /><input type="hidden" name="_wp_http_referer" value="/wordpress/wp-admin/edit.php" />
-->
<?php if($this->session->userdata('re_tgl_opsurat_awal')==''):?>
Dari
<select name='dd'>
<?php for($i=1;$i<=31;$i++){ ?>
<?php if($i>9){?>
<option value='<?php echo $i; ?>'><?php echo $i; ?></option>
<?php } else { ?>
<option value='<?php echo '0'.$i; ?>'><?php echo '0'.$i; ?></option>
<?php } ?>
<?php } ?>
</select>

<select name='mm'>
<?php for($i=1;$i<=12;$i++){ ?>
<?php if($i>9){?>
<option value='<?php echo $i; ?>'><?php echo $i; ?></option>
<?php } else { ?>
<option value='<?php echo '0'.$i; ?>'><?php echo '0'.$i; ?></option>
<?php } ?>
<?php } ?>
</select>

<select name='yyyy'>
<?php for($i=2010;$i<=2012;$i++){ ?>
<?php if($i>9){?>
<option value='<?php echo $i; ?>'><?php echo $i; ?></option>
<?php } else { ?>
<option value='<?php echo '0'.$i; ?>'><?php echo '0'.$i; ?></option>
<?php } ?>
<?php } ?>
</select>

s/d
<select name='dd2'>
<?php for($i=1;$i<=31;$i++){ ?>
<?php if($i>9){?>
<option value='<?php echo $i; ?>'><?php echo $i; ?></option>
<?php } else { ?>
<option value='<?php echo '0'.$i; ?>'><?php echo '0'.$i; ?></option>
<?php } ?>
<?php } ?>
</select>

<select name='mm2'>
<?php for($i=1;$i<=12;$i++){ ?>
<?php if($i>9){?>
<option value='<?php echo $i; ?>'><?php echo $i; ?></option>
<?php } else { ?>
<option value='<?php echo '0'.$i; ?>'><?php echo '0'.$i; ?></option>
<?php } ?>
<?php } ?>
</select>

<select name='yyyy2'>
<?php for($i=2010;$i<=2012;$i++){ ?>
<?php if($i>9){?>
<option value='<?php echo $i; ?>'><?php echo $i; ?></option>
<?php } else { ?>
<option value='<?php echo '0'.$i; ?>'><?php echo '0'.$i; ?></option>
<?php } ?>
<?php } ?>
</select>

<input type="submit" name="search" id="post-query-submit" value="Search" class="button-secondary" />
<?php else:?>
<input type="submit" name="reset" id="post-query-submit" value="Reset" class="button-secondary" />
<?php endif;?>
</div>
<?=form_close();?>

<div class="clear"></div>
</div>

<div class="clear"></div>

<?=$this->session->flashdata('message');?>

<table class="widefat post fixed" cellspacing="0">
	<!-- Head -->
    <thead>
	<tr>
	<th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox" /></th>
	<th scope="col" id="title" >No.Review</th>
	<th scope="col" id="author" >Tgl Review</th>
	<th scope="col" id="categories">Nama Klien</th>
	<th scope="col" id="tags">Alamat</th>
	<th scope="col" id="date">Keterangan</th>
    <th scope="col" id="rem"></th>
	</tr>
	</thead>
   <!-- Head -->
   <!-- Footer -->
	<tfoot>
	<tr>
	<th scope="col"><input type="checkbox" /></th>
	<th scope="col">No.Review</th>

	<th scope="col">Tanggal</th>
	<th scope="col">Nama Klien</th>
	<th scope="col">Alamat</th>
	<th scope="col">Keterangan</th>
    <th scope="col"></th>
	</tr>
	</tfoot>
    <!-- Footer -->

	<tbody>
	<?php if(count($surats)>0):?>
	<?php foreach ($surats as $rec): ?>
    <tr id='post-4' class='alternate author-self status-publish iedit' valign="top">
    <td><a href="#">#</td>
    <td><a href="#"><?='RE-'.$rec['no_op']; ?></a></td>
    <td><a href="#"><?=$rec['tanggal']; ?></a></td>
    <td><a href='#'><?=$rec['nama_klien']; ?></a></td>
    <td><?=$rec['alamat'];?></td>
    <td><?=$rec['keterangan']; ?></td>
    <td><br />
	<?php //if(date("Y-m-d") == $rec['tanggal']): ?>
	<?=anchor('opsurat/editRE/'.$rec['id'],'Edit',array('class'=>'button add-new-h2')); ?><p></p>
	<?=anchor('opsurat/removeRE/'.$rec['id'],'Remove',array('class'=>'button add-new-h2')); ?>
	<?php //endif; ?>
	</td>	     
   </tr>
   <?php endforeach; ?>
   <?php endif;?>   
	</tbody>
</table>

<?php //echo $this->element('paging'); ?>



